package com.hzit.portal.controller;


import com.hzit.portal.service.PortalService;
import com.hzit.manager.api.domain.Content;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@Controller
public class PortalController {

	@Autowired
	private PortalService portalService;
	//1. 查看欢迎页面
	@GetMapping({"/","/index.html"})
	public String index(Model model){
		//1.1 根据分类查询广告列表
		List<Content> contentList = portalService.findContentsByCid("1");
		//1.2 放到model中
		model.addAttribute("contentList",contentList);
		return "index";
	}
}
